package com.diandi.ddsb.vo;

/**
 * 奖券类型
 *
 */

public enum LotteryTicketType {


	PHYSICAL_TICKET(1, "实物券"), CASH_TICKET(2, "现金券"), ADDINTEREST_TICKET(3, "加息券"), EXPERIENCE_TICKET(4, "体验券"), FEE_WITH_TICKET(
			5, "费用抵用券"), THIRD_PACKAGE(6, "三方红包"), CASH_PACKAGE(7, "现金红包"), REACH_PACKAGE(8, "直抵券"), HOLIDAY_TICKET(9,
"度假票券"), VIRTUAL_CASH_TICKET(10, "虚拟现金券"), BACK_RATE_TICKET(11, "返现券"), INTEGRAL_TICKET(12, "积分券") ,FREE_TICKET(13,"免息券");


	/**
	 * value
	 */
	private final String text;
	/**
	 * key
	 */
	private final int value;

	LotteryTicketType(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public static LotteryTicketType getTextByValue(int value) {
		for (LotteryTicketType item : LotteryTicketType.values()) {
			if (item.getValue() == value) {
				return item;
			}
		}
		throw new RuntimeException(value + "不是合法的类型！");
	}

	public static LotteryTicketType getValueByText(String text) {
		for (LotteryTicketType item : LotteryTicketType.values()) {
			if (item.getText().equals(text)) {
				return item;
			}
		}
		throw new RuntimeException(text + "不是合法的类型！");
	}

	public String getText() {
		return text;
	}

	public int getValue() {
		return value;
	}

}
